package Initials;

import java.util.Hashtable;

import Market.LSE;
import Market.Market;

public class InitLSE {

        private double[][] LSEData;
        Object LSEobject;
        Hashtable LSEtab;
        private int J;

//C-O-N-S-T-R-U-C-T-O-R-----------------------------------------------------------------------	 
   public InitLSE(Market market){
	   
	   Hashtable<String, Double> electricityDemand = new Hashtable<String, Double>();
	   
	   Hashtable<String, Double> electricityDemand1 = new Hashtable<String, Double>();
	   Hashtable<String, Double> electricityDemand2 = new Hashtable<String, Double>();
	   Hashtable<String, Double> electricityDemand3 = new Hashtable<String, Double>();
	   
	   //creates ALL the LSE agent
	   for (int i=0; i<market.J;i++){
		   if (i == 0) {
			   
			    electricityDemand1.put("0",350d);
			    electricityDemand1.put("1",315d);
			    electricityDemand1.put("2",305d);
			    electricityDemand1.put("3",296d);
			    electricityDemand1.put("4",287d);
			    electricityDemand1.put("5",291d);
			    electricityDemand1.put("6",296d);
			    electricityDemand1.put("7",314d);
			    electricityDemand1.put("8",358d);
			    electricityDemand1.put("9",394d);
			    electricityDemand1.put("10",300d);
			    electricityDemand1.put("11",330d);
			    electricityDemand1.put("12",350d);
			    electricityDemand1.put("13",390d);
			    electricityDemand1.put("14",390d);
			    electricityDemand1.put("15",380d);
			    electricityDemand1.put("16",370d);
			    electricityDemand1.put("17",375d);
			    electricityDemand1.put("18",360d);
			    electricityDemand1.put("19",365d);
			    electricityDemand1.put("20",385d);
			    electricityDemand1.put("21",390d);
			    electricityDemand1.put("22",363d);
			    electricityDemand1.put("23",355d);
			    
			    electricityDemand = electricityDemand1;
		  
			    int id=i+1;
			    LSE lse = new LSE("lse"+id,2,electricityDemand);
			    market.lseList.put(lse.id, lse);
		   }		   
		   if (i == 1) {
			   
			    electricityDemand2.put("0",350d);
			    electricityDemand2.put("1",345d);
			    electricityDemand2.put("2",385d);
			    electricityDemand2.put("3",286d);
			    electricityDemand2.put("4",257d);
			    electricityDemand2.put("5",271d);
			    electricityDemand2.put("6",266d);
			    electricityDemand2.put("7",374d);
			    electricityDemand2.put("8",338d);
			    electricityDemand2.put("9",364d);
			    electricityDemand2.put("10",493d);
			    electricityDemand2.put("11",428d);
			    electricityDemand2.put("12",463d);
			    electricityDemand2.put("13",370d);
			    electricityDemand2.put("14",380d);
			    electricityDemand2.put("15",468d);
			    electricityDemand2.put("16",458d);
			    electricityDemand2.put("17",440d);
			    electricityDemand2.put("18",442d);
			    electricityDemand2.put("19",431d);
			    electricityDemand2.put("20",432d);
			    electricityDemand2.put("21",370d);
			    electricityDemand2.put("22",343d);
			    electricityDemand2.put("23",345d);
		  
			    electricityDemand = electricityDemand2;
			    
			    int id=i+1;
			    LSE lse = new LSE("lse"+id,3,electricityDemand);
			    market.lseList.put(lse.id, lse);			   			   
		   }
	   		
	   		if (i == 2) {
		   
	   			electricityDemand3.put("0",380d);
	   			electricityDemand3.put("1",335d);
	   			electricityDemand3.put("2",352d);
		    	electricityDemand3.put("3",276d);
		    	electricityDemand3.put("4",297d);
		    	electricityDemand3.put("5",201d);
		    	electricityDemand3.put("6",266d);
		    	electricityDemand3.put("7",344d);
		    	electricityDemand3.put("8",383d);
		    	electricityDemand3.put("9",374d);
		    	electricityDemand3.put("10",493d);
		    	electricityDemand3.put("11",498d);
		    	electricityDemand3.put("12",453d);
		    	electricityDemand3.put("13",320d);
		    	electricityDemand3.put("14",320d);
		    	electricityDemand3.put("15",458d);
		    	electricityDemand3.put("16",468d);
		    	electricityDemand3.put("17",440d);
		    	electricityDemand3.put("18",462d);
		    	electricityDemand3.put("19",491d);
		    	electricityDemand3.put("20",402d);
		    	electricityDemand3.put("21",350d);
		    	electricityDemand3.put("22",333d);
		    	electricityDemand3.put("23",325d);
	  
		    	electricityDemand = electricityDemand3;
		    	
		    	int id=i+1;
		    	LSE lse = new LSE("lse"+id,4,electricityDemand);
		    	market.lseList.put(lse.id, lse);		   			   
	   		}		 
	   	}
	
	  //  LSE lse_new  = market.lseList.get("lse"+2);	    
	  //  double kuku = lse_new.electricityDemand.get("21");
	     
	 
   }	
 
//-----------------------------------------------------------------------------------------------------------------------------------------
    /** Returns LSE Data  */
	public double[][] getLSEData(){	
		   return LSEData;
	}
	
//-----------------------------------------------------------------------------------------------------------------------------------------
	/** Returns number of LSEs */
	public int getNLSE(){		
		return J;
	}	
}
